var path = require('path');

const rename = require("gulp-rename");

var ret = {};

ret.srcroot = __dirname;

var isWin = /^win/.test(process.platform);

ret.destroot = "dist";

ret.dlibroot = "lib";

ret.babelenv = {
    "targets": {
        "browsers": ["IE >= 8"]
    }
};

ret.babelplugins = [
    ["transform-runtime", {
        "helpers": false,
        "polyfill": false,
        "regenerator": true
    }]
];

ret.sassresolve = function (sassbundler) {
    return sassbundler.pipe(rename(function (path) {
        path.extname = ".wxss"
    }))
};

ret.sasspath = path.join(ret.srcroot, "/sass/**/*.scss");

ret.csspath = path.join(ret.destroot, "/");

ret.sourcemaps = true;

ret.compileoptions = {

};

ret.uglify = true;

ret.espath = path.join(ret.srcroot, `/src/index.js`);

ret.jspath = "./";

module.exports = ret;